package me.passtime.projt.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Lee
 * Date: 11-12-6
 * Time: 下午4:19
 */
public class DateUtils {
    private static final DateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
    private static final DateFormat dateFormatter = new SimpleDateFormat("yyyy年MM月");
    private static final DateFormat dateTimeFormatter = new SimpleDateFormat("yyyyMMddHHmmss");
    private static final DateFormat yearMonthFormatter = new SimpleDateFormat("yyyyMM");

    public static String formatCurrentDate() {
        return dateFormat.format(new Date());
    }

    public static String formatDateToYearAndMonth(Date date) {
        return dateFormatter.format(date);
    }

    public static String formatDate(Date date) {
        return dateFormat.format(date);
    }
    
    public static String formatOrderDateTime(Date date){
        return dateTimeFormatter.format(date);
    }

    public static String formatDateToQueryYearMonth(Date date){
        return yearMonthFormatter.format(date);
    }
    
//    public static void main(String[] args){
//        System.out.println(formatDate(new Date()));
//    }
}
